package com.dyzx.hbb.modules.mtn.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 维修工单明细表，记录具体维修项目和费用
 * @TableName mtn_order_item
 */
@TableName(value ="mtn_order_item")
@Data
public class MtnOrderItem {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联工单ID
     */
    private Long orderId;

    /**
     * 关联维护项目ID
     */
    private Long workFlowId;

    /**
     * 操作员ID
     */
    private String salesmanId;

    /**
     * 服务时间
     */
    private Long serviceHours;

    /**
     * 服务结束
     */
    private Long serviceEndHours;

    /**
     * 配件费用
     */
    private Long partsAmt;

    /**
     * 提成费
     */
    private Long commission;

    /**
     * 服务费
     */
    private Long serviceAmt;
//service_total_amt
    /**
     * 服务费
     */
    private Long serviceTotalAmt;
    /**
     * 优惠费
     */
    private Long discountAmt;

    /**
     * 总费用
     */
    private Long totalAmt;

    /**
     * 项目执行备注（如配件型号、故障细节）
     */
    private String remark;

    /**
     * 工单状态（0-待接车；1-维修中；2-待结算；3-已完成；4-已取消）
     */
    private Integer status;

    /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateDate;

    /**
     * 删除标志
     */
    private Integer deleted;

    /**
     * 操作用户编号
     */
    private Long operatorId;

    /**
     * 企业编号
     */
    private Long organId;

    /**
     * 
     */
    private Long productId;

    /**
     * 
     */
    private Long discountId;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MtnOrderItem other = (MtnOrderItem) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getWorkFlowId() == null ? other.getWorkFlowId() == null : this.getWorkFlowId().equals(other.getWorkFlowId()))
            && (this.getSalesmanId() == null ? other.getSalesmanId() == null : this.getSalesmanId().equals(other.getSalesmanId()))
            && (this.getServiceHours() == null ? other.getServiceHours() == null : this.getServiceHours().equals(other.getServiceHours()))
            && (this.getServiceEndHours() == null ? other.getServiceEndHours() == null : this.getServiceEndHours().equals(other.getServiceEndHours()))
            && (this.getPartsAmt() == null ? other.getPartsAmt() == null : this.getPartsAmt().equals(other.getPartsAmt()))
            && (this.getCommission() == null ? other.getCommission() == null : this.getCommission().equals(other.getCommission()))
            && (this.getServiceAmt() == null ? other.getServiceAmt() == null : this.getServiceAmt().equals(other.getServiceAmt()))
            && (this.getServiceTotalAmt() == null ? other.getServiceTotalAmt() == null : this.getServiceTotalAmt().equals(other.getServiceTotalAmt()))
            && (this.getDiscountAmt() == null ? other.getDiscountAmt() == null : this.getDiscountAmt().equals(other.getDiscountAmt()))
            && (this.getTotalAmt() == null ? other.getTotalAmt() == null : this.getTotalAmt().equals(other.getTotalAmt()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getOrganId() == null ? other.getOrganId() == null : this.getOrganId().equals(other.getOrganId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getWorkFlowId() == null) ? 0 : getWorkFlowId().hashCode());
        result = prime * result + ((getSalesmanId() == null) ? 0 : getSalesmanId().hashCode());
        result = prime * result + ((getServiceHours() == null) ? 0 : getServiceHours().hashCode());
        result = prime * result + ((getServiceEndHours() == null) ? 0 : getServiceEndHours().hashCode());
        result = prime * result + ((getPartsAmt() == null) ? 0 : getPartsAmt().hashCode());
        result = prime * result + ((getCommission() == null) ? 0 : getCommission().hashCode());
        result = prime * result + ((getServiceAmt() == null) ? 0 : getServiceAmt().hashCode());
        result = prime * result + ((getServiceTotalAmt() == null) ? 0 : getServiceTotalAmt().hashCode());
        result = prime * result + ((getDiscountAmt() == null) ? 0 : getDiscountAmt().hashCode());
        result = prime * result + ((getTotalAmt() == null) ? 0 : getTotalAmt().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getOrganId() == null) ? 0 : getOrganId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderId=").append(orderId);
        sb.append(", workFlowId=").append(workFlowId);
        sb.append(", salesmanId=").append(salesmanId);
        sb.append(", serviceHours=").append(serviceHours);
        sb.append(", serviceEndHours=").append(serviceEndHours);
        sb.append(", partsAmt=").append(partsAmt);
        sb.append(", commission=").append(commission);
        sb.append(", serviceAmt=").append(serviceAmt);
        sb.append(", serviceTotalAmt=").append(serviceTotalAmt);
        sb.append(", discountAmt=").append(discountAmt);
        sb.append(", totalAmt=").append(totalAmt);
        sb.append(", remark=").append(remark);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", organId=").append(organId);
        sb.append(", productId=").append(productId);
        sb.append(", discountId=").append(discountId);
        sb.append("]");
        return sb.toString();
    }
}